﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SlaughterItem.Common.Infrastructures.Interfaces
{
    /// <summary>
    /// 基类仓储接口  where约束，可以被实例化
    /// </summary>
    /// <typeparam name="T">占位符</typeparam>
    public interface IBaseRepository<T> where T : class, new()
    {
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        IQueryable<T> GetAll();
        /// <summary>
        /// 新增
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        int Add(T t);

        /// <summary>
        /// 批量添加
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        int AddRange(List<T> t);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        int Update(T t);
    }
}
